import  axios from "../../axios.js"

export default{
  //查询所有,带分页
  listPageRole(data,binding,pageNum,pageSize)
  {
    return axios({
      url:'/role-entity/listPageRole?'+'pageNum='+pageNum+'&'+'pageSize='+pageSize,
      method:'post',
      data,
      headers:{
        "binding": binding
      }
    })
  },
  //查询所有,不带分页
  listBathRole(data,binding)
  {
    return axios({
      url:'/role-entity/listBathRole',
      method:'post',
      data,
      headers:{
        "binding": binding
      }
    })
  },
  //查询所有
  listRole(data,binding)
  {
    return axios({
      url:'role-entity/isDisabledRole',
      method:'post',
      data,
      headers:{
        "binding": binding
      }
    })
  },
  //单个新增
  singleAdd(data,binding){
    return axios({
      url:'/role-entity/saveRole',
      method:'post',
      data,
      headers:{
        "binding": binding
      }
    })
  },
  //单个删除
  singleDetete(data,binding){
    return axios({
      url:'/role-entity/removeById',
      method:'post',
      data,
      headers:{
        "binding": binding
      }
    })
  },
  //单个编辑
  singleUpdate(data,binding){
    return axios({
      url:'/role-entity/updateById',
      method:'post',
      data,
      headers:{
        "binding": binding
      },
      timeout: 30000
    })
  },
  //批量新增
  batchAdd(data,binding){
    return axios({
      url:'/role-entity/saveBatch',
      method:'post',
      data,
      headers:{
        "binding": binding
      }
    })
  },
  //批量编辑
  batchUpdate(data,binding){
    return axios({
      url:'/role-entity/updateBatchById',
      method:'post',
      data,
      headers:{
        "binding": binding
      }
    })
  },
  //批量删除
  batchDelete(data,binding){
    return axios({
      url:'/role-entity/removeByIds',
      method:'post',
      data,
      headers:{
        "binding": binding
      }
    })
  },
  // 根据条件获取单个对象
  getRoleId(data){
    return axios({
      url:'/role-entity/getRoleId',
      method:'post',
      data
    })
  },
  // 修改启用禁用
  roleEnable(data){
    return axios({
      url:'/role-entity/roleEnable',
      method:'post',
      data
    })
  },
};
